/**
 * 
 */
package mediator;

/**
 * PatternBox: "Colleague" implementation.
 * <ul>
 *   <li>each Colleague class knows its Mediator object.</li>
 *   <li>each colleague communicates with its mediator whenever it would have otherwise communicated with another colleague.</li>
 * </ul>
 * 
 * @author <a href="mailto:dirk.ehms@patternbox.com">Dirk Ehms</a>
 * @author lx
 */
public abstract class Colleague {

	/** stores the associated Mediator */
	private final Mediator fMediator;

	/** 
	 * Constructor
	 */
	public Colleague(Mediator mediator) {
		super();
		fMediator = mediator;
	}

	/** 
	 * Call this method from derived classes if a property of interest has been changed.
	 */
	protected void changed() {
		fMediator.colleagueChanged(this);
	}

}
